﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace Scheduledscheduling.Models.TaskOptionsShow
{
    public class TaskOptionsShow
    {
        public int Id { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string TaskName { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string GroupName { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public int Interval { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string ApiUrl { get; set; }
        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string AuthKey { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string AuthValue { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string Describe { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string RequestType { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public DateTime LastRunTime { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string StatusDesc { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public int Status { get; set; }

        public System.Timers.Timer TaskTimer { get; set; }

    }
    /// <summary>
    /// 枚举类型：任务状态
    /// </summary>
    public enum Status
    { 
        /// <summary>
        /// Desc: 任务未运行
        /// </summary>
        Working = 0,
        /// <summary>
        /// Desc: 任务开始
        /// </summary>
        Run = 1,
        /// <summary>
        /// Desc: 任务立即执行
        /// </summary>
        Execute = 2,
        /// <summary>
        /// Desc: 任务暂停
        /// </summary>
        Stop = 3
}
}

